package Zuoye;

import com.sun.javaws.IconUtil;

public class Zuoye3 {
    public static void main(String[] args) {
        /*
         * ######*
         * #####***
         * ####*****
         * ###*******
         * ##*********
         * #***********
         * i=1  2  3  4  5  6
         * k=6  5  4  3  2  1
         * */
        //3、使用 * 打印空心菱形图案。
        for (int i = 1; i <= 5; i++) {
            for (int k = 1; k <= 5 - i; k++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= (2 * i) - 1; j++) {
                if (j == 1 || j == 2 * i - 1) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");
                }
            }
            System.out.print("\n");
        }
        for (int i = 4; i > 0; i--) {
            for (int k = 1; k <= 5 - i; k++) {
                System.out.print(" ");
            }
            for (int j = 1; j <= (2 * i) - 1; j++) {
                if (j == 1 || j == 2 * i - 1) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");
                }
            }
            System.out.print("\n");
        }
    }
}
